<template>
    <view>
        <!-- pages/earningsRule/index.wxml -->
        <!-- 头部 -->
        <navber id="head-navber" :navbarData="navbarData"></navber>

        <view class="ear">
            <view class="ear-title">{{ title }}</view>
            <view class="ear-time">{{ time }}</view>
            <rich-text :nodes="content"></rich-text>
        </view>
        <view class="end"></view>
    </view>
</template>

<script>
import navber from '@/components/navber/index';
// pages/earningsRule/index.js
const Api = require('../../../api/index.js');

export default {
    components: {
        navber
    },
    data() {
        return {
            navbarData: {
                title: '协议声明' //顶部标题
            },
            //导航栏
            title: '',
            //标题
            time: '',
            //修改时间
            content: '' //内容
        };
    },
    onLoad(options) {
        let type = 1;

        if (options.type) {
            type = options.type;
        }

        var json = {
            type: type
        };
        Api.getProtocol(json).then((res) => {
            this.setData({
                title: res.data.title,
                time: res.data.update_time,
                content: res.data.content
            });
        });
    },
    methods: {}
};
</script>
<style>
@import './index.css';
</style>
